#!/bin/sh
#
# Author ： hbaolong@vip.qq.com
#
# Function : 给exceptwords文件中增加已经学会的词语
#
#
#

workdir="/Users/hbaolong/workshop/gitee/3place/ENMYDICT/"

dictfile="exceptwords.md"

dict_candidate="exceptwords_candidate.md"

if [ $# -lt 1 ]; then
	echo "Usage: $0 word [word]."
	exit
fi

for word in $@
do
	if isword $word; then 
		if ! grep -q -i -w $word $workdir$dictfile $workdir$dict_candidate;then 
			echo $word >> $workdir$dict_candidate
			echo $word" added"
		else
			echo $word" exist"
		fi
	fi
done

